import re
from datetime import datetime, timedelta


def collector():
    start = input('Please enter start date(yyyy-mm-dd):')
    end = input('Please enter end date(yyyy-mm-dd):')
    list = [start, end]
    return list

def check_format(date):
    if re.match('^\d{4}-\d{2}-\d{2}$', date):
        return True
    else:
        return False

def date_issuer(start_date, end_date, delta=1):
    start = datetime.strptime(start_date, '%Y-%m-%d')
    end = datetime.strptime(end_date, '%Y-%m-%d')
    td = timedelta(delta)
    date_length = end - start
    r = date_length.days + 1
    date_list = []
    for i in range(r):
        issued_date = start + td * i
        date_list.append(issued_date)
    return date_list

def url_date(date):
    return date.strftime('%Y-%m-%d')

def dig_date(date):
    return date.strftime('%Y%m%d')


